package com.wltjack.springboot.vo.enumtype;

import java.io.Serializable;

public enum OrganizationType implements Serializable {

	FREE_ORG("自由组织", 1), BUSINESS_ORG("商业组织", 2);

	// 成员变量
	private String name;
	private int id;

	// 构造方法
	private OrganizationType(String name, int id) {
		this.name = name;
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public int getId() {
		return id;
	}

	public static String getNameById(int id) {
		for (OrganizationType object : OrganizationType.values()) {
			if (object.id == id) {
				return object.name;
			}
		}
		return null;
	}

}
